<?php
/**
 * Created by PhpStorm.
 * User: Aliaksei Lazerka
 * Date: 10/3/14
 * Time: 9:15 PM
 */

namespace base;

if (!defined('NYMPH_ROOT')) {
  define('NYMPH_ROOT', dirname("../../../" . __FILE__));
  require(NYMPH_ROOT . '/local/loader/kernel/classes/URLClassLoader.php');
}

/**
 * The IDBActions interface provides methods
 * for executing some actions with databases
 */
interface IDBActions
{

  /**
   * (PHP 5)<br/>
   * Execute sql query
   * @param string $query
   * @return mixed query result or false if query failed
   */
  public function executeStringQuery($query);

  /**
   * (PHP 5)<br/>
   * Get error occurred
   * @return string error
   */
  public function getQueryError();

  /**
   * (PHP 5)<br/>
   * Connect to db
   * @param string $url
   * @param string $db
   * @param string $user
   * @param string $password
   * @return mixed query result or false if query failed
   */
  public function connectToDB($url, $db, $user, $password);

  /**
   * (PHP 5)<br/>
   * Close database connection
   * @return bool
   */
  public function closeConnection();
} 